<%@page import="java.sql.*"%>
<%
try{
String category=request.getParameter("count");
String[] category1=category.split(";");
String id=null;
int i;
for(i=0;i<category1.length;i++)
{
	if(i==0)
		id=category1[i];
}

 String buffer="<select name='sub_category' multiple=''>";  
 
 Class.forName("com.mysql.jdbc.Driver").newInstance();  
 Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/ebay","root","bhaguji");  
 Statement stmt = con.createStatement();  
 ResultSet rs = stmt.executeQuery("Select * from subcategory where catid='"+id+"' ");  
   while(rs.next()){
   buffer=buffer+"<option value='"+rs.getString(1)+";"+rs.getString(2)+"'>"+rs.getString(2)+"</option>";  
   }  
 buffer=buffer+"</select>";  
 response.getWriter().println(buffer); 
 }
 catch(Exception e){
     System.out.println(e);
 }

 %>